package suray.rgv.communication.util;

/**
 * 两栖车动作
 */
public enum RgvOperation {
    INVALID(-1, "INVALID", "无效"),
    Wait(0, "Wait", "不做动作"),
    JackLoad(1, "JackLoad", "顶升抬起加载货物"),
    JackUnLoad(2, "JackUnload", "顶升下降"),
    JackHeight(3, "JackHeight", "顶升顶高"),
    ForkLoad(4, "ForkLoad", "货叉抬起加载货物"),
    ForkUnload(5, "ForkUnload", "货叉下降"),
    ForkHeight(6, "ForkHeight", "货叉顶高"),
    ForkForward(7, "ForkForward", "货叉前移"),
    RollerLoad(8, "RollerLoad", "滚筒加载货物"),
    RollerRoll(9, "RollerRoll", "滚筒转动"),
    RollerPreLoad(10, "RollerPreLoad", "滚筒预加载货物"),
    RollerStop(11, "RollerStop", "滚筒停止"),
    RollerPass(12, "RollerPass", "RollerPass"),
    RollerInverse(13, "RollerInverse", "RollerInverse"),
    RollerInverseReset(14, "RollerInverseReset", "RollerInverseReset"),
    HookLoad(15, "HookLoad", "牵引货物"),
    HookUnload(16, "HookUnload", "卸载货物"),
    RollerUnLoad(17, "RollerUnLoad", "滚筒卸载货物"),
    ;

    int value;
    String strValue;
    String des;

    RgvOperation(int value, String strValue, String des) {
        this.value = value;
        this.strValue = strValue;
        this.des = des;
    }

    public int getValue() {
        return value;
    }

    public String getStrValue() {
        return strValue;
    }

    public static RgvOperation parseValue(int value) {
        for (RgvOperation rgvOperation : RgvOperation.values()) {
            if (rgvOperation.value == value) {
                return rgvOperation;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
